package com.szwistar.iot;

import java.lang.reflect.Field;

public class CoAttrInfo {
	Class<?> type;	// 类型
	String name;	// 变量名
    String title;
    String unit;
    String rangeType;
    String range;
    String description;
    String group;
    String enableOn;
    boolean required;

	public CoAttrInfo() {}

	// 从注解信息中生成
	public CoAttrInfo(Field field, CoAttrDef anno) {
		type = field.getType();
		name = field.getName();
		title = anno.title();
		unit = anno.unit();
		rangeType = anno.rangeType();
		range = anno.range();
		description = anno.description();
		required = anno.required();
		group = anno.group();
		enableOn = anno.enableOn();
	}

    public Class<?> getType() { return type; }
	public String getName() { return name; }
	public String getTitle() { return title; }
	public String getRangeType() { return rangeType; }
	public String getRange() { return range; }
	public String getUnit() { return unit; }
	public String getDescription() { return description; }
	public String getGroup() { return group; }
	public String getEnableOn() { return enableOn; }
	public Boolean getRequired() { return required; }
}
